<template>
	<a-card
		style="width: 100%"
		:bordered="false"
		:tab-list="tabListNoTitle"
		:active-tab-key="noTitleKey"
		@tabChange="(key) => onTabChange(key, 'noTitleKey')"
	>
		<p v-if="noTitleKey === 'beginFlow'">
			<beginFlow />
		</p>
		<p v-else-if="noTitleKey === 'myDraft'">
			<myDraft />
		</p>
	</a-card>
</template>
<script setup name="newTask">
	import beginFlow from './beginFlow/index.vue'
	import myDraft from './myDraft/index.vue'
	const key = ref('beginFlow')
	const noTitleKey = ref('beginFlow')
	const tabListNoTitle = [
		{
			key: 'beginFlow',
			tab: '发起流程'
		},
		{
			key: 'myDraft',
			tab: '我的草稿'
		}
	]

	const onTabChange = (value, type) => {
		if (type === 'key') {
			key.value = value
		} else if (type === 'noTitleKey') {
			noTitleKey.value = value
		}
	}
</script>
